package org.mq.mymq.common.enums;

/**
 * @ClassName BrokerRegistryEnum
 * @Description
 * @Author jiarong_ye
 * @Date 2025/7/10 11:16
 * @Version 1.0
 */
public enum BrokerRegistryRoleEnum {
    MASTER("master"),
    SLAVE("slave"),
    SINGLE("single"),
    ;

    String code;

    BrokerRegistryRoleEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static BrokerRegistryRoleEnum of(String code) {
        for (BrokerRegistryRoleEnum e : BrokerRegistryRoleEnum.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }
}
